#include "xftp_factory.hpp"
#include "thread_task.hpp"
#include "xftp_server_cmd.hpp"
#include "xftp_user.hpp"
#include "xftp_list.hpp"
#include "xftp_port.hpp"
xftp_factory::xftp_factory(/* args */)
{
}

xftp_factory::~xftp_factory()
{
}
xftp_factory* xftp_factory::getInstance()
{
    static xftp_factory factory;
    return &factory;
}
thread_task* xftp_factory::crate_task()
{
    xftp_server_cmd *cmd = new xftp_server_cmd();
    auto user = new xftp_user();
    cmd->registration_command("USER",user);
    auto pwd = new xftp_list();
    cmd->registration_command("PWD",pwd);
    cmd->registration_command("LIST",pwd);
    auto port = new xftp_port();
    cmd->registration_command("PORT",port);
    // 注册ftp消息处理对象
    // cmd->registration_command("USER",)
    return cmd;
}